import { createRouter, createWebHashHistory } from "vue-router";

const routes = [{
        //登录界面
        path: "/",
        name: "login",
        component: () =>
            import ( /*webpackChunkNames:'Login'*/ "@/page/login/login.vue"),
    },
    {
        //主界面
        path: "/index",
        name: "index",
        component: () =>
            import ( /*webpackChunkNames:'Index'*/ "@/page/index/index.vue"),
        //二级路由
        redirect: "/userpage",
        children: [{
                path: "/userpage",
                name: "userpage",
                component: () =>
                    import ( /*webpackChunkNames:'Userpage'*/ "@/page/user_page/user.vue"),
            } /*用户管理*/ ,
            {
                path: "/dataAnalysis",
                name: "dataAnalysis",
                component: () =>
                    import (
                        /*webpackChunkNames:'DataAnalysis'*/
                        "@/page/DataAnalysis/DataAnalysis.vue"
                    ),
            } /*数据分析*/ ,
            {
                path: "/order",
                name: "order",
                component: () =>
                    import ( /*webpackChunkNames:'Order'*/ "@/page/Order/order.vue"),
            } /*订单管理*/ ,
            {
                path: "/dish",
                name: "dish",
                component: () =>
                    import ( /*webpackChunkNames:'Dish'*/ "@/page/Dish/dish.vue"),
            } /*菜品管理*/ ,
            {
                path: "/dishuplod",
                name: "dishuplod",
                component: () =>
                    import ( /*webpackChunkNames:'DishUplod'*/ "@/page/Dish/upload/upload_dish.vue"),
            } /*菜品添加*/ ,
            //三级路由
            {
                path: "/employees",
                name: "employees",

                children: [{
                        path: "/employees/course",
                        name: "course",
                        component: () =>
                            import (
                                /*webpackChunkNames:'Course'*/
                                "@/page/Employees/Course/course.vue"
                            ),
                    },
                    {
                        path: "/employees/employee",
                        name: "employee",
                        component: () =>
                            import (
                                /*webpackChunkNames:'Employee'*/
                                "@/page/Employees/employee/employee.vue"
                            ),
                    },
                ],
            } /*员工管理*/ ,
        ],
    },
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;